#include "nvencvideoencoderfactory.h"

#include <absl/strings/match.h>
#include "webrtc_ffmpegencoder.h"
#include "nvencvideoencoder.h"
#include "modules/video_coding/codecs/h264/include/h264.h"


std::unique_ptr<webrtc::VideoEncoder>
NVENCVideoEncoderFactory::CreateVideoEncoder(
    const webrtc::SdpVideoFormat& format) {
  if (absl::EqualsIgnoreCase(format.name, cricket::kH264CodecName)) {
#if 1
   // return NVENCVideoEncoder::Create(format);
#else
    //return WebrtcFFmpegEncoder::Create(format);
#endif
  }else {
    return nullptr;
  }
}

std::vector<webrtc::SdpVideoFormat>
NVENCVideoEncoderFactory::GetSupportedFormats() const {
  std::vector<webrtc::SdpVideoFormat> supported_codecs;
  supported_codecs.emplace_back(cricket::kH264CodecName);
  //supported_codecs.emplace_back(cricket::kVp8CodecName);
  return supported_codecs;
}

webrtc::VideoEncoderFactory::CodecSupport NVENCVideoEncoderFactory::QueryCodecSupport(    
    const webrtc::SdpVideoFormat& format, absl::optional<std::string> scalability_mode) const 
{
    webrtc::VideoEncoderFactory::CodecSupport info;
  info.is_supported = false;
  return info;
}
